﻿namespace Supermarket.Client
{
    using System;
    using MongoDB.Bson;
    using MongoDB.Bson.Serialization;
    using MongoDB.Bson.Serialization.Attributes;
    using MongoDB.Driver;
    using MongoDB.Driver.Builders;
    using System.Linq;
    using System.Runtime.Serialization;
    using System.Xml;
    using System.Threading;
    using System.Globalization;
    using SupermarketSQLite.Model;

    class Program
    {
        static void Main(string[] args)
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

            //MsSqlManager.MigrateDataFromMySqlToMSSql();

            //string zipPath = "../../Sample-Sales-Reports.zip";

            string destinationPath = "../../SalesReports";

            //ZipManager.Unzip(zipPath, destinationPath);

            //ExcelFilesManager.ReadExcelData(destinationPath);

            //ZipManager.DeleteTempFiles(destinationPath);

            //PdfManager.CreateSalesReportPdfFile("../../SalesReports/SalesReport.pdf");

            //XmlManager.PrintToXML();

            string mongoConnectionString = Settings.Default.MongoDbConnectionString;
            //ProductReportsManager.CreateAndSaveProductReports(mongoConnectionString, "../../");

            //string xmlExpenses = "../../expenses.xml";
            //XmlManager.ReadXmlExpenses(xmlExpenses);

            var productReports = MongoDbManager.ReadProductsReport(mongoConnectionString, "SupermarketProductReports", "ProductsReports");

            SQLiteManager.InsertProductReports(productReports);
        }
    }
}
